<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<%@ include file="/WEB-INF/views/include/easyui.jsp"%>
<script type="text/javascript">

</script>
</head>
<body>
<div>
	<form id="mainform" action="${ctx}/messagepush/${action}" method="post">
	<table  class="formTable" align="center">
		<tr>
			<td>
			<input type="radio" id="sendToOne" name="sendTo" value="1" onclick="enableEdit()" checked/><label for="disable">发送给单个用户</label>
			<input type="text" id="telephone" name="telephone" data-options="width:150,prompt: '手机号'"/>（手机号）
			</td>
		</tr>
		<tr>
			<td>
				<input type="radio" id="sendToAll" name="sendTo" value="0" onclick="disableEdit()"/><label for="able">发送给所有用户</label>			
			</td>
		</tr>
		<tr>
				<td>消息内容：<textarea rows="11" cols="70" name="msgContent" align="center"></textarea></td>
		</tr>
	</table>
	</form>
</div>

<script type="text/javascript">
function enableEdit()
{
	var input=document.getElementById('telephone');
	input.removeAttribute('disabled');
}	
function disableEdit()
{
	var input=document.getElementById('telephone');
	input.setAttribute('disabled','disabled');
}

$(function(){
	
	$('#mainform').form({    
	    onSubmit: function(){    
	    	var isValid = $(this).form('validate');
			return isValid;	// 返回false终止表单提交
	    },    
	    success:function(data){   
	    	if(successTip(data,dg,d))
	    		dg.treegrid('reload');
	    }    
	}); 
});

</script>

</body>
</html>